<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/common/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
 
<html>
	<head>
	<meta http-equiv="content-Type" content="text/html; charset=utf-8" />
		<title>tueye添加广告位置-tueye广告管理-tueye专业的图片欣赏交流社区</title>
		
		<script type="text/javascript" src="<%=request.getContextPath() %>/script/jquery.js"></script>
	</head>

	<body>
		<form method="post">
		<input name="id" id="id" type="hidden" value="${adsite.id}" />
		<input name="type" id="type" type="hidden" value="" />
		<input name="moduleId" id="moduleId" type="hidden" value="" />
		
			<table>
				<tr>
					<td>
						<label for="projects">
							    &nbsp;&nbsp;&nbsp;&nbsp;广告位置名：
						</label>
						<input name="adsite_name" id="adsite_name" type="text" value="${adsite.adsite_name}" size=24 />
					</td>
				</tr>
				<tr>
					<td>
						<label for="projects">
							广告位置描述：
						</label>
						<input name="adsite_description" id="adsite_description" type="text" value="${adsite.adsite_description}" size=24 />
					</td>
				</tr>
								<tr>
					<td>
						<label for="projects">
							模块名称：
						</label>
						<input name="moduleName" id="moduleName" type="text" value="${adsite.moduleName}" size=24 readonly="readonly"/>
						<img src="<%=request.getContextPath() %>/themes/images/find3.gif" alt="查找" onclick="getKeyWord();"/>
					</td>
				</tr>
				
								<tr>
					<td>
						<label for="projects">
							模块标示：
						</label>
						<input name="modulePlate" id="modulePlate" type="text" value="${adsite.modulePlate}" size=24 readonly="readonly"/>
					</td>
				</tr>
				
				<tr>
					<td align="center">
						<input type="button" value="保存" onclick="savePageName()" />
						&nbsp;&nbsp;
					</td>
				</tr>


			</table>
		</form>
		<script>
// 验证,然后 保存界面
function savePageName()
{
 
var adsite_name=$("#adsite_name").val();
 
var adsite_description=$("#adsite_description").val();

var moduleName=$("#moduleName").val();

var moduleId=$("#moduleId").val();

var modulePlate=$("#modulePlate").val();

if(adsite_name==""||adsite_name==null ) 
{
alert("广告位置名称不能为空!")
$("#adsite_name").focus();
  return;
}

if(moduleName==""||moduleName==null ) 
{
alert("模块名称不能为空!")
$("#moduleName").focus();
  return;
}

if(adsite_description==""||adsite_description==null ) 
{
alert(adsite_description);
alert("广告位置描述不能为空!")
$("#adsite_description").focus();
  return;
} 

var id = $('#id').val();
var type = $('#type').val();
var sendData="adsite_name="+ encodeURIComponent(adsite_name)+"&adsite_description="+encodeURIComponent(adsite_description)
+"&date="+new Date()+"&id="+id+"&type="+type+"&moduleId="+moduleId+"&moduleName="+encodeURIComponent(moduleName)+"&modulePlate="+encodeURIComponent(modulePlate); 

    		$.ajax({ 
			url: "<%=request.getContextPath()%>/adsite.do?action=save" ,
			type:'post', //数据发送方式 
			dataType:'action', //接受数据格式 
			data: sendData , 
			// beforeSend: function() {$("<img src='../images/wait18.gif' />").appendTo("#DivTblContact")},  
			success:update_page //回传函数(这里是函数名)   error转向错误页面
            }); 
            
}
    function update_page(obj) { //ajax保存成功后,触发 id为rain 的onclick事件
          window.location.reload();
     } 		 




function getKeyWord(){
	var theUrl = "<%=request.getContextPath()%>/pages/admin/sysdic/sysdicvalueList.jsp";
	var width = 500;
	var heigh = 400;
	window.open(theUrl,'','menubar=no, z-look=yes, scrollbars=yes, toolbar=no, status=yes, resizable=no, width='+ width +', height='+heigh);

}

</script>
	</body>
</html>
